package com.huice.cases;


import java.util.List;
import java.util.Map;
import org.testng.annotations.DataProvider;
import org.testng.annotations.Test;
import com.huice.base.ExcelParser;



public class Case01{

	
	@Test(dataProvider="demo")
	public void test01(Map<String, String> data){
		for (String key : data.keySet()) {
			System.out.println(key+":"+data.get(key));
		}
	}
	
	
	@DataProvider(name="demo")
	public Object[][] getdata(){
		ExcelParser e = new ExcelParser("d:/test.xls");
		String caseName = this.getClass().getSimpleName();		
		List<Map<String, String>> list = e.getData(caseName);
		Object[][] result = new Object[list.size()][];			
		for (int i=0;i<list.size();i++) {
			Object[] temp = new Object[]{list.get(i)};
			result[i] = temp;
		}
		return result;
	}
}
